#!/usr/bin/env python

import os, sys
os.environ["DISPLAY"] = "localhost:0.0"

from INFILE import siteid, wfoid, maindir
sys.path.append('%s/data_parsers' % maindir)
os.chdir(maindir)
# Hourly update model output and SREF
os.system('/home/disk/pvort/lmadaus/nobackup/pylibs/epd/bin/python %s/plot_bufkit.py -s %s -e' % (maindir,siteid.upper()))
os.system('/home/disk/pvort/lmadaus/nobackup/pylibs/epd/bin/python %s/plot_sref.py -s %s -e' % (maindir,siteid.upper()))



from surface_parse_bufkit import get_todays_verification
verify = get_todays_verification(siteid,wfoid.upper())

for key in verify.keys():
    print verify[key]
    high = '%2.0f' % verify[key][0]
    low =  '%2.0f' % verify[key][1]
    wind = '%2.0f' % (verify[key][3]) # * 0.868976242)
    precip ='%1.2f' % float(verify[key][4])
os.system('/home/disk/pvort/lmadaus/nobackup/pylibs/epd/bin/python %s/write_wxchall_page.py -m "Hrly. model summ. and SREF update" -i %s -l %s -w %s -p %s' % (maindir,high,low,wind,precip))
